package Test;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author feng
 * @Date 2021/9/22 12:48
 */
public class Test03 {
    public static void main(String[] args) {
        System.out.println("请输入一个double类型的数据:");
        Scanner sc = new Scanner(System.in);
        double[] array = new double[5];
        for (int i = 0; i < array.length; i++) {
            array[i] = sc.nextDouble();
        }
        double min = min(array);
        System.out.println(min);
    }

    public static double min(double[] array) {

        Arrays.sort(array);
        double min = array[0];
        // 找出最小值
        for (int i = 0; i < array.length; i++) {
            if (array[i] < min) {
                min = array[i];
            }
        }
        return min;
    }
}
